
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  
<!-- Mirrored from werkzeug.palletsprojects.com/en/1.0.x/installation/ by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 15 Sep 2020 06:37:03 GMT -->
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Installation &#8212; Werkzeug Documentation (1.0.x)</title>
    <link rel="stylesheet" href="../_static/werkzeug.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../../../assets.readthedocs.org/static/css/badge_only.css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script async="async" type="text/javascript" src="../../../../assets.readthedocs.org/static/javascript/readthedocs-doc-embed.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex/index.html" />
    <link rel="search" title="Search" href="../search/index.html" />
    <link rel="next" title="Werkzeug Tutorial" href="../tutorial/index.html" />
    <link rel="prev" title="Werkzeug" href="../index.html" />
    <link rel="canonical" href="index.html">
  <script>DOCUMENTATION_OPTIONS.URL_ROOT = '../index.html';</script>
   
  
<!-- RTD Extra Head -->

<!-- 
Always link to the latest version, as canonical.
http://docs.readthedocs.org/en/latest/canonical.html
-->
<link rel="canonical" href="index.html" />

<link rel="stylesheet" href="../../../../assets.readthedocs.org/static/css/readthedocs-doc-embed.css" type="text/css" />

<script type="text/javascript" src="../_static/readthedocs-data.js"></script>

<!-- Add page-specific data, which must exist in the page js, not global -->
<script type="text/javascript">
READTHEDOCS_DATA['page'] = "installation"
READTHEDOCS_DATA['source_suffix'] = ".rst"
</script>

<script type="text/javascript" src="../../../../assets.readthedocs.org/static/javascript/readthedocs-analytics.js" async="async"></script>

<!-- end RTD <extrahead> -->
</head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex/index.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex/index.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../tutorial/index.html" title="Werkzeug Tutorial"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../index.html" title="Werkzeug"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">Werkzeug Documentation (1.0.x)</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="installation">
<span id="id1"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
<div class="section" id="python-version">
<h2>Python Version<a class="headerlink" href="#python-version" title="Permalink to this headline">¶</a></h2>
<p>We recommend using the latest version of Python 3. Werkzeug supports
Python 3.5 and newer and Python 2.7.</p>
</div>
<div class="section" id="dependencies">
<h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h2>
<p>Werkzeug does not have any direct dependencies.</p>
<div class="section" id="optional-dependencies">
<h3>Optional dependencies<a class="headerlink" href="#optional-dependencies" title="Permalink to this headline">¶</a></h3>
<p>These distributions will not be installed automatically. Werkzeug will
detect and use them if you install them.</p>
<ul class="simple">
<li><a class="reference external" href="https://simplejson.readthedocs.io/en/latest/">SimpleJSON</a> is a fast JSON implementation that is compatible with
Python’s <code class="docutils literal notranslate"><span class="pre">json</span></code> module. It is preferred for JSON operations if it is
installed.</li>
<li><a class="reference external" href="https://pypi.org/project/click/">Click</a> provides request log highlighting when using the
development server.</li>
<li><a class="reference external" href="https://pypi.org/project/watchdog/">Watchdog</a> provides a faster, more efficient reloader for the
development server.</li>
</ul>
</div>
</div>
<div class="section" id="virtual-environments">
<h2>Virtual environments<a class="headerlink" href="#virtual-environments" title="Permalink to this headline">¶</a></h2>
<p>Use a virtual environment to manage the dependencies for your project,
both in development and in production.</p>
<p>What problem does a virtual environment solve? The more Python
projects you have, the more likely it is that you need to work with
different versions of Python libraries, or even Python itself. Newer
versions of libraries for one project can break compatibility in
another project.</p>
<p>Virtual environments are independent groups of Python libraries, one for
each project. Packages installed for one project will not affect other
projects or the operating system’s packages.</p>
<p>Python 3 comes bundled with the <a class="reference external" href="https://docs.python.org/3/library/venv.html#module-venv" title="(in Python v3.8)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">venv</span></code></a> module to create virtual
environments. If you’re using a modern version of Python, you can
continue on to the next section.</p>
<p>If you’re using Python 2, see <a class="reference internal" href="#install-install-virtualenv"><span class="std std-ref">Install virtualenv</span></a> first.</p>
<div class="section" id="create-an-environment">
<span id="install-create-env"></span><h3>Create an environment<a class="headerlink" href="#create-an-environment" title="Permalink to this headline">¶</a></h3>
<p>Create a project folder and a <code class="file docutils literal notranslate"><span class="pre">venv</span></code> folder within:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>mkdir myproject
<span class="nb">cd</span> myproject
python3 -m venv venv
</pre></div>
</div>
<p>On Windows:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -3 -m venv venv
</pre></div>
</div>
<p>If you needed to install virtualenv because you are on an older version
of Python, use the following command instead:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>virtualenv venv
</pre></div>
</div>
<p>On Windows:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>\Python27\Scripts\virtualenv.exe venv
</pre></div>
</div>
</div>
<div class="section" id="activate-the-environment">
<h3>Activate the environment<a class="headerlink" href="#activate-the-environment" title="Permalink to this headline">¶</a></h3>
<p>Before you work on your project, activate the corresponding environment:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>. venv/bin/activate
</pre></div>
</div>
<p>On Windows:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>venv\Scripts\activate
</pre></div>
</div>
<p>Your shell prompt will change to show the name of the activated
environment.</p>
</div>
</div>
<div class="section" id="install-werkzeug">
<h2>Install Werkzeug<a class="headerlink" href="#install-werkzeug" title="Permalink to this headline">¶</a></h2>
<p>Within the activated environment, use the following command to install
Werkzeug:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pip install Werkzeug
</pre></div>
</div>
<div class="section" id="living-on-the-edge">
<h3>Living on the edge<a class="headerlink" href="#living-on-the-edge" title="Permalink to this headline">¶</a></h3>
<p>If you want to work with the latest Werkzeug code before it’s released,
install or update the code from the master branch:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pip install -U https://github.com/pallets/werkzeug/archive/master.tar.gz
</pre></div>
</div>
</div>
</div>
<div class="section" id="install-virtualenv">
<span id="install-install-virtualenv"></span><h2>Install virtualenv<a class="headerlink" href="#install-virtualenv" title="Permalink to this headline">¶</a></h2>
<p>If you are using Python 2, the venv module is not available. Instead,
install <a class="reference external" href="https://virtualenv.pypa.io/en/latest/">virtualenv</a>.</p>
<p>On Linux, virtualenv is provided by your package manager:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Debian, Ubuntu</span>
sudo apt-get install python-virtualenv

<span class="c1"># CentOS, Fedora</span>
sudo yum install python-virtualenv

<span class="c1"># Arch</span>
sudo pacman -S python-virtualenv
</pre></div>
</div>
<p>If you are on Mac OS X or Windows, download <a class="reference external" href="https://bootstrap.pypa.io/get-pip.py">get-pip.py</a>, then:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo python2 Downloads/get-pip.py
sudo python2 -m pip install virtualenv
</pre></div>
</div>
<p>On Windows, as an administrator:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>\Python27\python.exe Downloads\get-pip.py
\Python27\python.exe -m pip install virtualenv
</pre></div>
</div>
<p>Now you can continue to <a class="reference internal" href="#install-create-env"><span class="std std-ref">Create an environment</span></a>.</p>
</div>
</div>


          </div>
        </div>
      </div>
  <span id="sidebar-top"></span>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  
    
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/werkzeug.png" alt="Logo"/>
            </a></p>
  

  <h3>Contents</h3>
  <ul>
<li><a class="reference internal" href="#">Installation</a><ul>
<li><a class="reference internal" href="#python-version">Python Version</a></li>
<li><a class="reference internal" href="#dependencies">Dependencies</a><ul>
<li><a class="reference internal" href="#optional-dependencies">Optional dependencies</a></li>
</ul>
</li>
<li><a class="reference internal" href="#virtual-environments">Virtual environments</a><ul>
<li><a class="reference internal" href="#create-an-environment">Create an environment</a></li>
<li><a class="reference internal" href="#activate-the-environment">Activate the environment</a></li>
</ul>
</li>
<li><a class="reference internal" href="#install-werkzeug">Install Werkzeug</a><ul>
<li><a class="reference internal" href="#living-on-the-edge">Living on the edge</a></li>
</ul>
</li>
<li><a class="reference internal" href="#install-virtualenv">Install virtualenv</a></li>
</ul>
</li>
</ul>
<h3>Navigation</h3>
<ul>
  <li><a href="../index.html">Overview</a>
    <ul>
          <li>Previous: <a href="../index.html" title="previous chapter">Werkzeug</a>
          <li>Next: <a href="../tutorial/index.html" title="next chapter">Werkzeug Tutorial</a>
    </ul>
  </li>
</ul>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://werkzeug.palletsprojects.com/en/1.0.x/search/" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
  
    <div class="footer" role="contentinfo">
        &#169; Copyright 2007 Pallets.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5.
    </div>
    <script>
      if (typeof READTHEDOCS_DATA !== 'undefined') {
        if (!READTHEDOCS_DATA.features) {
          READTHEDOCS_DATA.features = {};
        }
        READTHEDOCS_DATA.features.docsearch_disabled = true;
      }
    </script>

  </body>

<!-- Mirrored from werkzeug.palletsprojects.com/en/1.0.x/installation/ by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 15 Sep 2020 06:37:03 GMT -->
</html>